import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [{
    path: "/",
    redirect: "/login",
  },
  // 登录路由
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/login.vue"),
    meta: {
      title: "登录",
    },
  },
  // 登录路由结束

  // 用户平台路由模块开始
  {
    path: "/userDemo",
    name: "userDemo",
    component: () => import("@/views/menhupingtai/userDemo.vue"),
    children: [{
        path: "/menhuDemo1",
        name: "menhuDemo1",
        component: () => import("@/components/menhuoingtai/menhuDemo1.vue"),
        meta: {
          title: "快捷应用",
          name: "快捷应用",
        },
      },
      {
        path: "/menhuDemo2",
        name: "menhuDemo2",
        component: () => import("@/components/menhuoingtai/menhuDemo2.vue"),
        meta: {
          title: "其他应用",
          name: "其他应用",
        },
      },
    ],
  },
  // 用户平台路由模块结束
  {
    //总容器路由
    path: "/home",
    name: "home",
    component: () => import("@/views/demo1/home.vue"),
    meta: {
      title: "首页",
    },
    children: [{ //系统首页
        path: "/xitongshouye",
        name: "xitongshouye",
        component: () => import("@/views/xitongshouye/xitongshouye.vue"),
        meta: {
          title: "系统首页",
          name: "系统首页",
          icon: "",
        },
        children: [{
            path: "/security",
            nmae: "security",
            component: () => import("@/views/zonghe/security.vue"),
            meta: {
              title: "综合安防",
              name: "综合安防",
              icon: "el-icon-office-building",
            },
            children: [{
                path: "/shipinjiankong",
                name: "shipinjiankong",
                component: () => import("@/components/anfang/shipin.vue"),
                meta: {
                  title: "视频监控",
                  name: "视频监控",
                  icon: "",
                },
              },
              {
                path: "/menjin",
                name: "menjin",
                component: () => import("@/components/anfang/menjin.vue"),
                meta: {
                  title: "门禁管理",
                  name: "门禁管理",
                  icon: "",
                },
              },
              {
                path: "/jinjibaojing",
                name: "jinjibaojing",
                component: () => import("@/components/anfang/jinji.vue"),
                meta: {
                  title: "紧急报警",
                  name: "紧急报警",
                  icon: "",
                },
              },
            ],
          },
          {
            path: "/demo2",
            nmae: "demo2",
            component: () => import("@/views/demo2/demo2.vue"),
            meta: {
              title: "停车管理",
              icon: "el-icon-setting",
              name: "停车管理",
            },
          },
          {
            path: "/menjin",
            name: "menjin",
            component: () => import("@/components/anfang/menjin.vue"),
            meta: {
              title: "能耗检测",
              icon: "el-icon-setting",
              name: "能耗检测",
            },
          },
          {
            path: "/demo4",
            nmae: "demo4",
            component: () => import("@/views/huanjing/environment.vue"),
            meta: {
              title: "环境监测",
              icon: "el-icon-setting",
              name: "环境监测",
            },
          },
          {
            path: "/room",
            nmae: "room",
            component: () => import("@/views/jifang/room.vue"),
            meta: {
              title: "机房监控",
              icon: "el-icon-setting",
              name: "机房监控",
            },
          },
          {
            path: "/call",
            nmae: "call",
            component: () => import("@/views/baojing/call.vue"),
            meta: {
              title: "报警管理",
              icon: "el-icon-setting",
              name: "报警管理",
            },
          },
          {
            path: "/elevator",
            nmae: "elevator",
            component: () => import("@/views/dianti/elevator.vue"),
            meta: {
              title: "电梯监控",
              icon: "el-icon-setting",
              name: "电梯监控",
            },
          },
        ],
      },
      {
        path: '',
        name: '',
        // component:()=>import('')
        meta: {
          name: '设备配置'
        }
      }
    ]
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;